#ifndef _RADIAN_MAIN_CAMERA_CONTROLLER_H_
#define _RADIAN_MAIN_CAMERA_CONTROLLER_H_

#include "RadianCommon.h"
#include "RadianEditorController.h"

class RadianMainEditorController : public RadianEditorController
{
	Q_OBJECT

public:
	RadianMainEditorController(Ogre::Camera* camera, QWidget* parentWidget,RadianRenderWnd* parentRenderWindow);
	virtual ~RadianMainEditorController();

	/* Override all the controll interfaces.
	*/
	
	/* On key press.
	*/
	virtual void OnKeyPress(QKeyEvent* evt);

	/* On key press.
	*/
	virtual void OnKeyRelease(QKeyEvent* evt);

	/* On mouse move.
	*/
	virtual void OnMouseMove(QMouseEvent* evt);

	/* On mouse press.
	*/
	virtual void OnMousePress(QMouseEvent* evt);

	/* On mouse press.
	*/
	virtual void OnMouseRelease(QMouseEvent* evt);

	/* On key press.
	*/
	virtual void OnMouseDoublePress(QMouseEvent* evt);

	/* On mouse wheel.
	*/
	virtual void OnMouseWheel(QWheelEvent* evt);

	/* Event handling.
	*/
	virtual bool eventFilter(QObject *target, QEvent *event);

	/* Cancel scelect all objects.
	*/
	void UnSelectAllObjects();

	/* set select flag.		
	*/
	void RecursionSelectAllChildsNode(Ogre::SceneNode* sceneNode,bool isSelected);

	/* Update the controller.
	*/
	virtual void Update(float timeElapsed);

	/* Focus to scene node.
	*/
	virtual void FocusTo(const Math::AxisAlignedBox& aabb);


protected:
	bool mIsFlying;									// flag: if the camra in flying.
	bool mIsTargeting;								// flag: if the camra in targeting.
	Math::Vector3 mLastLookAtPosition;				// last camera look at position.
	RadianAxisDrawer* mAxisDrawer;					// axis drawer helper.
};
#endif
